package hk.polyu;

import java.util.*;

/**
 * CollectionInfo class containing all information about the collections.
 * @author hezongjian
 *
 */
public class CollectionInfo {
	
	HashMap<Integer, DocumentInfo>	mDocs;
	
	/**
	 * Default constructor
	 */
	public CollectionInfo() {
		this.mDocs = new HashMap<Integer, DocumentInfo>();
	}
	
	
	public void addDocument(int id, DocumentInfo doc) {
		this.mDocs.put(id, doc);
	}
	
	public int getCollectionLength() {
		int nTotal = 0;
		for (DocumentInfo d : this.mDocs.values()) {
			nTotal += d.getLength();
		}
		return nTotal;
	}

}
